package com.sgg.cglib.inter;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author ：brid
 * @date ：Created in 2021/5/19 14:14
 * @description：
 * @modified By：
 * @version: $
 */
public class MyMethodInterceptor implements MethodInterceptor {


    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("---插入前置通知---");
        Object invoke = method.invoke(o, objects);
        System.out.println("---插入后置通知---");
        return invoke;
    }
}
